<template>
  <div class="page_body">
    <div class="home_top">
      <img
        class="home_top_back"
        src="../../assets/image/black_icon01.png"
        alt="返回"
        @click="toBackFn()"
      />
      <div class="home_top_title">
        {{ stepKey == 1 ? "基本信息" : "" }}{{ stepKey == 4 ? "专业信息" : ""
        }}{{ stepKey == 3 ? "执教信息" : ""
        }}{{ stepKey == 2 ? "证件信息" : "" }}
      </div>
    </div>
    <div class="register_body">
      <div
        style="
          width: 100vw;
          display: flex;
          flex-direction: column;
          align-items: center;
        "
      >
        <div class="register_form_box">
          <!-- 基本信息栏 -->
          <div v-if="stepKey == 1">
            <div class="register_form_item border_item">
              <div class="border_item_popup_box" style="height: 100%">
                <div class="coach_register_form_upload_img">
                  <div class="border_item_title">
                    <div class="border_item_title_tips">*</div>
                    照片(不超过3M的2寸免冠照)
                  </div>
                  <div
                    class="border_item_popup no_value_item"
                    style="width: 4.8rem; height: 0.94rem; line-height: 0.94rem"
                  >
                    注意：必须为个人近期免冠证件照
                  </div>
                </div>

                <div class="upload_img_box">
                  <img
                    v-if="userData.photo == null || userData.photo == ''"
                    class="upload_img_box_icon"
                    src="../../assets/image/upload_img_bg03.png"
                  />
                  <img
                    v-if="userData.photo != null && userData.photo != ''"
                    class="upload_img_box_icon"
                    :src="userData.photo"
                  />
                  <input
                    type="file"
                    accept="image/*"
                    ref="uploadImg"
                    id="upload_img_btn"
                    @change="uploadImgBtn($event)"
                    :disabled="!inputKey"
                  />
                </div>
                <img
                  src="../../assets/image/to_icon03.png"
                  class="popup_icon"
                />
              </div>
            </div>

            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                姓名
              </div>
              <input
                class="register_form_item_input"
                placeholder="请输入您的姓名"
                type="text"
                v-model="userData.name"
                maxlength="15"
                :disabled="!inputKey"
              />
            </div>
            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                联系方式
              </div>
              <input
                class="register_form_item_input"
                placeholder="请输入手机号"
                type="text"
                v-model="userData.phone"
                maxlength="11"
                :disabled="!inputKey"
              />
            </div>

            <!-- <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                证件类型
              </div>
              <div
                class="border_item_popup_box"
                @click="openPopup('identityType')"
              >
                <div
                  :class="[
                    identityTypevalueObj.label == '请选择'
                      ? 'border_item_popup no_value_item'
                      : 'border_item_popup',
                  ]"
                >
                  {{ identityTypevalueObj.label }}
                </div>
                <img
                  src="../../assets/image/to_icon03.png"
                  class="popup_icon"
                />
              </div>
            </div> -->

            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                证件号
              </div>
              <input
                class="register_form_item_input"
                placeholder="请输入您的证件号"
                type="text"
                v-model="userData.identity_number"
                maxlength="30"
                :disabled="!inputKey"
              />
            </div>

            <div class="sexandbrith">
              <div class="register_form_items border_item sexand">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  性别
                </div>
                <div class="border_item_popup_box" @click="openPopup('sex')">
                  <div
                    :class="[
                      userData.sex == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ userData.sex }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="register_form_items border_item sexand">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  生日
                </div>
                <div class="border_item_popup_box" @click="openPopup('brith')">
                  <div
                    :class="[
                      userData.brith == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ userData.brith }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>
            </div>
            <div class="sexandbrith">
              <div class="register_form_items border_item sexand">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  身高(CM)
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入您的身高"
                  type="number"
                  v-model="userData.height"
                  maxlength="5"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_items border_item sexand">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  体重(KG)
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入您的体重"
                  type="number"
                  v-model="userData.weight"
                  maxlength="5"
                  :disabled="!inputKey"
                />
              </div>
            </div>
            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                所属区
              </div>
              <div
                class="border_item_popup_box"
                @click="openPopup('registerRegion')"
              >
                <div
                  :class="[
                    userData.coach_register_region == '请选择'
                      ? 'border_item_popup no_value_item'
                      : 'border_item_popup',
                  ]"
                >
                  {{ userData.coach_register_region }}
                </div>
                <img
                  src="../../assets/image/to_icon03.png"
                  class="popup_icon"
                />
              </div>
            </div>

            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                工作单位/学校
              </div>
              <div
                class="border_item_popup_box"
                @click="openPopup('workunitandschool')"
              >
                <div
                  :class="[
                    userData.coach_identity == '请选择'
                      ? 'border_item_popup no_value_item'
                      : 'border_item_popup',
                  ]"
                >
                  {{ userData.coach_identity }}
                </div>
                <img
                  src="../../assets/image/to_icon03.png"
                  class="popup_icon"
                />
              </div>
            </div>
            <div
              class="register_form_item border_item"
              v-if="this.userData.coach_identity == '学校'"
            >
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                入学时间
              </div>
              <div class="border_item_popup_box" @click="openPopup('intake')">
                <div
                  :class="[
                    userData.enrollment_date == '请选择'
                      ? 'border_item_popup no_value_item'
                      : 'border_item_popup',
                  ]"
                >
                  {{ userData.enrollment_date }}
                </div>
                <img
                  src="../../assets/image/to_icon03.png"
                  class="popup_icon"
                />
              </div>
            </div>
            <div
              class="register_form_item border_item"
              v-if="this.userData.coach_identity == '学校'"
            >
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                学校名称
              </div>
              <input
                class="register_form_item_input"
                placeholder="请输入您的学校"
                type="text"
                v-model="userData.company"
                maxlength="20"
                :disabled="!inputKey"
              />
            </div>
            <div v-if="this.userData.coach_identity == '工作单位'">
              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  工作单位
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入您的工作单位"
                  type="text"
                  v-model="userData.company"
                  maxlength="20"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  职务
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入您的职位"
                  type="text"
                  v-model="userData.position"
                  maxlength="20"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  最高学历
                </div>
                <div
                  class="border_item_popup_box"
                  @click="openPopup('education')"
                >
                  <div
                    :class="[
                      userData.education == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ userData.education }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  毕业院校
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入您的毕业院校"
                  type="text"
                  v-model="userData.school"
                  maxlength="20"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  毕业时间
                </div>
                <div
                  class="border_item_popup_box"
                  @click="openPopup('graduationDate')"
                >
                  <div
                    :class="[
                      userData.graduation_date == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ userData.graduation_date }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>
            </div>
            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                邮箱
              </div>
              <input
                class="register_form_item_input"
                placeholder="请输入您的邮箱"
                type="email"
                v-model="userData.email"
                maxlength="40"
                :disabled="!inputKey"
              />
            </div>

            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                邮寄地址
              </div>
              <input
                class="register_form_item_input"
                placeholder="请输入您的邮寄地址"
                type="text"
                v-model="userData.address"
                maxlength="30"
                :disabled="!inputKey"
              />
            </div>
            <div class="register_form_item border_item">
              <div class="border_item_title">
                <div class="border_item_title_tips">*</div>
                证件类型
              </div>
              <van-dropdown-menu>
                <van-dropdown-item
                  @change="change"
                  v-model="userData.value1"
                  :options="option1"
                  :disabled="!inputKey"
                />
              </van-dropdown-menu>
            </div>
          </div>
          <div
            class="register_from_item upload_img_item"
            style="justify-content: space-around; margin-top: 0.4rem"
            v-if="userData.value1 == 1 && stepKey == 1"
          >
            <div class="upload_file_box">
              <img
                v-if="
                  userData.identity_up == null || userData.identity_up == ''
                "
                class="upload_file_box_img"
                src="../../assets/image/identity_up_img01.png"
              />
              <img
                v-if="
                  userData.identity_up != null && userData.identity_up != ''
                "
                class="upload_file_box_img"
                :src="userData.identity_up"
              />

              <input
                type="file"
                accept="image/*"
                ref="identityUp"
                class="upload_file_box_input"
                @change="uploadIdentityBtn($event, '1')"
                :disabled="!inputKey"
              />
              <div class="upload_file_box_btn">+上传身份证人像面</div>
            </div>
            <div class="upload_file_box">
              <img
                v-if="
                  userData.identity_down == null || userData.identity_down == ''
                "
                class="upload_file_box_img"
                src="../../assets/image/identity_down_img01.png"
              />
              <img
                v-if="
                  userData.identity_down != null && userData.identity_down != ''
                "
                class="upload_file_box_img"
                :src="userData.identity_down"
              />
              <input
                type="file"
                accept="image/*"
                ref="identityDown"
                class="upload_file_box_input"
                @change="uploadIdentityDownBtn($event, '2')"
                :disabled="!inputKey"
              />
              <div class="upload_file_box_btn">+上传身份证国徽面</div>
            </div>
          </div>
          <div class="imgs" v-if="userData.value1 == 2 && stepKey == 1">
            <div class="upload_file_box">
              <img
                v-if="
                  userData.identity_up == null || userData.identity_up == ''
                "
                class="upload_file_box_img"
                src="../../assets/image/upload_img_bg02.png"
              />
              <img
                v-if="
                  userData.identity_up != null && userData.identity_up != ''
                "
                class="upload_file_box_img"
                :src="userData.identity_up"
              />

              <input
                type="file"
                accept="image/*"
                ref="identityUp"
                class="upload_file_box_input"
                @change="uploadbut($event, '1')"
              />
              <div class="upload_file_box_btn">+上传证件个人信息面</div>
            </div>
            <div class="upload_file_box">
              <img
                v-if="
                  userData.identity_down == null || userData.identity_down == ''
                "
                class="upload_file_box_img"
                src="../../assets/image/upload_img_bg02.png"
              />
              <img
                v-if="
                  userData.identity_down != null && userData.identity_down != ''
                "
                class="upload_file_box_img"
                :src="userData.identity_down"
              />

              <input
                type="file"
                accept="image/*"
                ref="identityUp"
                class="upload_file_box_input"
                @change="uploadbutdown($event, '2')"
                :disabled="!inputKey"
              />
              <div class="upload_file_box_btn">+证件有效期页</div>
            </div>
          </div>
          <div
            class="imgs"
            v-if="
              (userData.value1 == 3 && stepKey == 1) ||
              (userData.value1 == 4 && stepKey == 1)
            "
          >
            <div class="upload_file_box">
              <img
                v-if="
                  userData.identity_up == null || userData.identity_up == ''
                "
                class="upload_file_box_img"
                src="../../assets/image/upload_img_bg02.png"
              />
              <img
                v-if="
                  userData.identity_up != null && userData.identity_up != ''
                "
                class="upload_file_box_img"
                :src="userData.identity_up"
              />

              <input
                type="file"
                accept="image/*"
                ref="identityUp"
                class="upload_file_box_input"
                @change="uploadbut($event, '1')"
                :disabled="!inputKey"
              />
              <div class="upload_file_box_btn">+上传证件个人信息面</div>
            </div>
          </div>

          <div v-if="stepKey == 1">
            <div
              v-for="(item, index) in userData.coach_experience_info"
              :key="index"
            >
              <div
                class="register_form_send_btnss"
                v-if="stepKey == 1 && inputKey && item.index != 0"
                @click="traindeleteItem(item, index)"
              >
                删除
              </div>
              <div class="border_item_titlelins">执教{{ index + 1 }}</div>
              <div class="register_form_item border_item">
                <div class="border_item_title" style="align-items: flex-end">
                  <div class="border_item_title_tips"></div>
                  执教单位
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_experience"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title" style="align-items: flex-end">
                  <div class="border_item_title_tips"></div>
                  执教职务
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_position"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  开始时间
                </div>
                <div
                  class="border_item_popup_box"
                  @click="openPopup('coach_train_begin_date', item.index)"
                >
                  <div
                    :class="[
                      item.coach_train_begin_date == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ item.coach_train_begin_date }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  结束时间
                </div>
                <div
                  class="border_item_popup_box"
                  @click="openPopup('coach_train_end_date', item.index)"
                >
                  <div
                    :class="[
                      item.coach_train_end_date == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ item.coach_train_end_date }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title" style="align-items: flex-end">
                  <div class="border_item_title_tips_ex">(选填)</div>
                  期间所获成绩及荣誉
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_honor"
                  :disabled="!inputKey"
                />
              </div>

              <div class="form_title" style="align-items: flex-end">
                <div class="border_item_title_tips_ex">(选填)</div>
                成绩及荣誉证明材料
              </div>
              <div class="form_tips_s">
                选择上传附件(最多5个)，限制每个5MB以内
              </div>
              <div class="form_tips_s" style="margin: 0.1rem 0 0.4rem">
                仅支持：jpg、jpeg、png、gif、bmp、psd、tif
              </div>
              <div class="coach_register_form_item">
                <div
                  class="upload_file_box_noBtn"
                  v-for="(items, index) in item.coach_honor_image"
                  :key="index"
                >
                  <img class="upload_file_box_noBtn_img" :src="items" />
                  <img
                    src="../../assets/image/remove_icon01.png"
                    class="remove_icon"
                    @click="removeImg(index, 2, item.index)"
                  />
                </div>

                <div
                  class="upload_file_box_noBtn"
                  v-if="item.coach_honor_image.length < 5"
                >
                  <div class="upload_file_box_noBtn_bg">
                    <img
                      class="upload_file_box_noBtn_icon"
                      src="../../assets/image/upload_img_icon01.png"
                    />
                    <input
                      type="file"
                      accept="image/*"
                      ref="uploadCoachHonorImage"
                      class="upload_file_box_noBtn_input"
                      @change="uploadCoachHonorImageBtn($event, item.index)"
                      :disabled="!inputKey"
                    />
                  </div>
                </div>
              </div>
            </div>
            <div
              class="register_form_send_btn"
              v-if="stepKey == 1 && inputKey"
              @click="clickexperience"
            >
              新增
            </div>
          </div>
          <!-- 证件信息栏 -->
          <div v-if="stepKey == 2">
            <div
              v-for="(item, index) in userData.coach_certificate_info"
              :key="index"
            >
              <div
                class="register_form_send_btnss"
                v-if="stepKey == 2 && inputKey && item.index != 0"
                @click="deleteItem(item, index)"
              >
                删除
              </div>
              <div class="border_item_titlelins">证书{{ index + 1 }}</div>
              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  证书名称
                </div>

                <van-dropdown-menu>
                  <van-dropdown-item
                    @change="
                      certificate_change(
                        item.index,
                        item.coach_certificate_title
                      )
                    "
                    v-model="item.coach_certificate_title"
                    :options="item.coach_certificatelist"
                  />
                </van-dropdown-menu>
              </div>

              <div
                class="register_form_item border_item"
                style="margin-top: 0.26rem"
              >
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  证书等级
                </div>
                <div class="form_tips_s">
                  请仔细核对与证书内容一致，否则无法通过审核!
                </div>
                <!-- <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_certificate_level"
                  :disabled="!inpuCertificatetKey"
                /> -->

                <van-dropdown-menu>
                  <van-dropdown-item
                    v-model="item.coach_certificate_level"
                    :options="item.coach_certificate_levell"
                  />
                </van-dropdown-menu>
              </div>

              <div
                class="register_form_item border_item"
                style="margin-top: 0.26rem"
              >
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  证书编号
                </div>
                <div class="form_tips_s">
                  请仔细核对与证书内容一致，否则无法通过审核!
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_certificate_number"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  证书签发日期
                </div>

                <div
                  class="border_item_popup_box"
                  @click="openPopup('certificateDate', item.index)"
                >
                  <div
                    :class="[
                      item.coach_certificate_date == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ item.coach_certificate_date }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips">*</div>
                  发证单位
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_certificate_company"
                  :disabled="!inputKey"
                />
              </div>

              <div class="form_title">
                <div class="border_item_title_tips">*</div>
                证书图片
              </div>

              <div class="coach_register_form_item">
                <div
                  class="upload_file_box_noBtn"
                  v-for="(items, index) in item.coach_certificate_image"
                  :key="index"
                >
                  <img class="upload_file_box_noBtn_img" :src="items" />
                  <img
                    src="../../assets/image/remove_icon01.png"
                    class="remove_icon"
                    @click="removeImg(index, 1, item.index)"
                  />
                </div>

                <div
                  class="upload_file_box_noBtn"
                  v-if="item.coach_certificate_image.length < 3"
                >
                  <div class="upload_file_box_noBtn_bg">
                    <img
                      class="upload_file_box_noBtn_icon"
                      src="../../assets/image/upload_img_icon01.png"
                    />
                    <input
                      type="file"
                      accept="image/*"
                      ref="uploadCoachTrainImage"
                      class="upload_file_box_noBtn_input"
                      @change="
                        uploadCoachCertificateImageBtn($event, item.index)
                      "
                      :disabled="!inputKey"
                    />
                  </div>
                </div>
              </div>

              <!-- 专业信息栏 -->
              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  培训名称
                </div>
                <div class="form_tips_s">
                  请仔细核对与证书内容一致，否则无法通过审核!
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_train_title"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  培训单位
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_train_company"
                  :disabled="!inputKey"
                />
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  培训地点
                </div>
                <input
                  class="register_form_item_input"
                  placeholder="请输入"
                  type="text"
                  v-model="item.coach_train_address"
                  :disabled="!inputKey"
                />
              </div>
              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  开始时间
                </div>

                <div
                  class="border_item_popup_box"
                  @click="openPopup('coach_train_begin_date', item.index)"
                >
                  <div
                    :class="[
                      item.coach_train_begin_date == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ item.coach_train_begin_date }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="register_form_item border_item">
                <div class="border_item_title">
                  <div class="border_item_title_tips"></div>
                  结束时间
                </div>

                <div
                  class="border_item_popup_box"
                  @click="openPopup('coach_train_end_date', item.index)"
                >
                  <div
                    :class="[
                      item.coach_train_end_date == '请选择'
                        ? 'border_item_popup no_value_item'
                        : 'border_item_popup',
                    ]"
                  >
                    {{ item.coach_train_end_date }}
                  </div>
                  <img
                    src="../../assets/image/to_icon03.png"
                    class="popup_icon"
                  />
                </div>
              </div>

              <div class="form_title">
                <div class="border_item_title_tips"></div>
                参加培训的证明材料
              </div>
              <div class="form_tips_s_m">
                请上传参加认证培训相关的手册、名单、教材或现场图片
              </div>
              <div class="form_tips_s">
                选择上传附件(最多5个)，限制每个5MB以内
              </div>
              <div class="form_tips_s" style="margin: 0.1rem 0 0.4rem">
                仅支持：jpg、jpeg、png、gif、bmp、psd、tif
              </div>
              <div class="coach_register_form_item">
                <div
                  class="upload_file_box_noBtn"
                  v-for="(items, index) in item.coach_train_image"
                  :key="index"
                >
                  <img class="upload_file_box_noBtn_img" :src="items" />
                  <img
                    src="../../assets/image/remove_icon01.png"
                    class="remove_icon"
                    @click="removeImg(index, 3, item.index)"
                  />
                </div>

                <div
                  class="upload_file_box_noBtn"
                  v-if="item.coach_train_image.length < 5"
                >
                  <div class="upload_file_box_noBtn_bg">
                    <img
                      class="upload_file_box_noBtn_icon"
                      src="../../assets/image/upload_img_icon01.png"
                    />
                    <input
                      type="file"
                      accept="image/*"
                      ref="uploadCoachTrainImage"
                      class="upload_file_box_noBtn_input"
                      @change="uploadCoachTrainImageBtn($event, item.index)"
                      :disabled="!inputKey"
                    />
                  </div>
                </div>
              </div>
            </div>
            <div
              class="register_form_send_btn"
              v-if="stepKey == 2 && inputKey"
              @click="clickDocumen"
            >
              新增
            </div>
          </div>
          <div v-if="auditStatus == 0">
            <div
              class="register_form_send_btn"
              v-if="stepKey == 1"
              @click="nextStep()"
            >
              下一步
            </div>

            <div
              class="register_form_send_btn"
              v-if="stepKey == 2"
              @click="submitDataFn()"
            >
              提交
            </div>
          </div>
          <div v-if="auditStatus == 2">
            <div
              class="register_form_send_btn"
              v-if="stepKey == 1"
              @click="nextStep()"
            >
              下一步
            </div>
            <div class="register_form_send_btn">审核通过</div>
            <div
              class="register_form_send_btn"
              v-if="stepKey == 2"
              @click="toHome()"
            >
              返回
            </div>
          </div>
          <div v-if="auditStatus == 1 || auditStatus == 3">
            <div
              class="register_form_send_btn"
              v-if="stepKey == 1"
              @click="nextStep()"
            >
              下一步
            </div>
            <div
              class="register_form_send_btn"
              v-if="(stepKey == 1 || stepKey == 2) && !inputKey"
              @click="reSubmitDataFn()"
            >
              {{ auditStatus == 1 ? "审核中(重新提交)" : "审核失败(重新提交)" }}
            </div>
            <div
              v-if="
                (stepKey == 1 || stepKey == 2) && !inputKey && auditStatus == 2
              "
            >
              {{ coach_remark }}
            </div>
            <div
              class="register_form_send_btn"
              v-if="stepKey == 3 && isCertificate == 2 && inputKey"
              @click="submitDataFn()"
            >
              提交
            </div>
            <div
              class="register_form_send_btn"
              v-if="stepKey == 2 && inputKey"
              @click="submitDataFn()"
            >
              提交
            </div>
            <!-- <div
              class="register_form_send_btn"
              v-if="stepKey == 2 && isCertificate == 2"
              @click="nextStep()"
            >
              补充证件信息
            </div> -->
          </div>
        </div>
      </div>
    </div>

    <!-- popup选择器 -->
    <mt-popup
      v-model="popupVisible"
      position="bottom"
      @touchmove.native.stop.prevent
    >
      <div class="popup_body">
        <div class="popup_body_top">
          <div @click="popupCancelFn()" class="popup_body_top_cancel">取消</div>
          <div @click="popupConfirmFn()" class="popup_body_top_confirm">
            确认
          </div>
        </div>
        <mt-picker
          style="width: 100%"
          ref="popupPicker"
          :slots="pickerSlots"
          :visibleItemCount="visibleItemCount"
          :valueKey="valueKey"
          @change="onPickerChange"
        ></mt-picker>
      </div>
    </mt-popup>
    <!-- 时间选择 -->
    <mt-datetime-picker
      ref="picker"
      type="date"
      v-model="pickerValue"
      @confirm="handleConfirm"
      :startDate="startDate"
      :endDate="endDate"
      @touchmove.native.stop.prevent
    >
    </mt-datetime-picker>
  </div>
</template>
<style src="../../assets/css/coach/coachRegister.css" scoped></style>

<script>
import { MessageBox, Indicator, Toast } from "mint-ui";
import { DropdownMenu, DropdownItem } from "vant";
export default {
  name: "CoachRegister",
  components: {
    [DropdownMenu.name]: DropdownMenu,
    [DropdownItem.name]: DropdownItem,
  },
  data() {
    return {
      baseAPIUrl: this.$store.state.baseAPIUrl,
      stepKey: 1, // 步骤条值
      coach_remark: "",
      userData: {
        photo: "", // 照片
        name: "", // 姓名
        phone: "", //手机号
        identity_type: 1, // 证件类型 1：身份证 2：护照 3：港、澳、台胞证件 4：其它
        identity_number: "", // 证件号
        sex: "请选择", // 性别
        brith: "请选择", //生日
        coach_identity: "请选择", //工作单位/学校
        enrollment_date: "请选择", //入学时间
        height: "", // 身高
        weight: "", // 体重
        coach_register_region: "请选择", // 所属区
        company: "", // 工作单位
        position: "", //职位
        education: "请选择", // 最高学历
        school: "", // 毕业院校
        graduation_date: "请选择", // 毕业时间
        email: "", // 邮箱
        address: "", // 邮寄地址

        identity_down: "", //身份证反面
        identity_up: "", //身份证正面

        // coach_certificate_title: "", // 证书名称
        // coach_certificate_level: "", // 证书等级
        // coach_certificate_number: "", // 证书编号
        // coach_certificate_date: "请选择", // 证书签发日期
        // coach_certificate_company: "", // 发证单位
        // coach_certificate_image: "", // 证书图片

        value1: 1,

        coach_certificate_info: [
          //证件信息数组
          {
            coach_certificate_title: "请选择", // 证书名称
            coach_certificate_level: "请选择", // 证书等级
            coach_certificatelist: [], //证书名称
            coach_certificate_levell: [], //证书等级
            coach_certificate_number: "", // 证书编号
            coach_certificate_date: "请选择", // 证书签发日期
            coach_certificate_company: "", // 发证单位
            coach_certificate_image: [], // 证书图片
            index: 0,
            coach_train_title: "", // 培训名称
            coach_train_address: "", // 培训地点
            coach_train_image: [], // 参加培训的证明材料
            coach_train_begin_date: "请选择", //培训开始时间
            coach_train_end_date: "请选择", //培训结束时间
            coach_train_company: "", //培训单位
          },
        ],
        //执教信息数组
        coach_experience_info: [
          {
            coach_experience: "", // 执教单位
            coach_position: "", // 执教职务
            coach_train_begin_date: "请选择", //执教开始时间
            coach_train_end_date: "请选择", //执教结束时间
            coach_honor: "", // 执教期间所获成绩及荣誉
            coach_honor_image: [], // 成绩及荣誉证明材料
            index: 0,
          },
        ],
      },
      userCoachId: "", // 教练员ID
      uploadUrl: "", // 提交用图片路径Q
      pickerValue: "", // 时间选择值
      startDate: new Date("1900-01-01"),
      endDate: new Date("2100-01-01"),
      // popup选择相关
      pickerSlots: [], // popup中Slots
      visibleItemCount: 5, // picker备选数
      popupVisible: false, // popup显示
      popupKey: "", // 当前选择器内容
      valueKey: "", // 当 values 为对象数组时，作为文本显示在 Picker 中的对应字段的字段名
      sexSlots: [
        {
          flex: 1,
          values: ["请选择", "男", "女"],
          textAlign: "center",
        },
      ], // 性别slots
      sexChange: "请选择", // 性别选择
      workunitandschoolarr: [
        {
          flex: 1,
          values: ["请选择", "工作单位", "学校"],
          textAlign: "center",
        },
      ], // 工作单位、/学校
      coach_identity: "请选择", // 工作单位、/学校选择
      identityTypeSlots: [
        {
          flex: 1,
          values: ["请选择", "身份证", "护照", "港、澳、台胞证件", "其他"],
          textAlign: "center",
        },
      ], // 证件类型slots
      identityTypeChange: "请选择", // 证件类型选择
      identityTypevalueObj: {
        value: 1,
        label: "身份证",
      }, // 证件类型选择值
      registerRegionSlots: [
        {
          flex: 1,
          values: [
            "请选择",
            "黄浦区",
            "徐汇区",
            "长宁区",
            "静安区",
            "普陀区",
            "虹口区",
            "杨浦区",
            "闵行区",
            "宝山区",
            "嘉定区",
            "浦东新区",
            "金山区",
            "松江区",
            "青浦区",
            "奉贤区",
            "崇明区",
          ],
          textAlign: "center",
        },
      ], // 所属区slots
      registerRegionChange: "请选择", // 所属区选择
      educationSlots: [
        {
          flex: 1,
          values: ["请选择", "大专", "本科", "硕士研究生", "博士"],
          textAlign: "center",
        },
      ], // 学历slots
      educationChange: "请选择", // 学历选择值
      inputKey: true, // 输入控制
      inpuCertificatetKey: true, // 输入控制
      auditStatus: 0, // 审核状态
      isCertificate: 2, // 是否填写证件1：已录入 2：未录入
      option1: [
        { text: "请选择证件类型", value: 0 },
        { text: "身份证", value: 1 },
        { text: "护照", value: 2 },
        { text: "港、澳、台胞证件 ", value: 3 },
        { text: "其他 ", value: 4 },
      ],
      value1: 1,
      coach_certificatelist: [], //
      coach_certificate_levell: [],
      idname: "", //身份证上名字
      idnumber: "", //身份证上证件号
      identity_up: "", //身份证正面 证件照片正面
      identity_down: "", //身份证 反面
      imggea: "",
      dowarr: [],
      Documentarrindex: 0,
      coach_certificate_title: "",
      coach_certificate_levells: "",
      // coach_certificate: "请选择证件",
    };
  },
  created: function () {
    this.checkUserInfoFn();
    this.coach_certificatearr();
    // console.log(this.userData.coach_certificate_info);

    // console.log(sessionStorage.getItem("COACHREGISTEROBJ"));
  },
  updated() {
    if (this.userData.coach_experience_info.length == 0) {
      this.userData.coach_experience_info.push({
        coach_experience: "", // 执教单位
        coach_position: "", // 执教职务
        coach_train_begin_date: "请选择", //执教开始时间
        coach_train_end_date: "请选择", //执教结束时间
        coach_honor: "", // 执教期间所获成绩及荣誉
        coach_honor_image: [], // 成绩及荣誉证明材料
        index: this.userData.coach_experience_info.length,
      });
    }
    console.log(this.userData.coach_experience_info);
  },
  methods: {
    // 打开popup选择
    openPopup: function (key, itemindex) {
      if (this.inputKey) {
        this.popupKey = key;
        this.valueKey = "";
        if (key == "identityType") {
          this.pickerSlots = this.identityTypeSlots;
          this.$refs.popupPicker.setSlotValue(
            0,
            this.identityTypevalueObj.label
          );
          this.popupVisible = true;
        }
        if (key == "sex") {
          this.pickerSlots = this.sexSlots;
          this.$refs.popupPicker.setSlotValue(0, this.userData.sex);
          this.popupVisible = true;
        }
        if (key == "brith") {
          if (this.userData.brith == "请选择") {
            this.pickerValue = new Date("1990-01-01");
          } else {
            this.pickerValue = new Date(this.userData.brith);
          }
          this.$refs.picker.open();
        }
        if (key == "workunitandschool") {
          this.pickerSlots = this.workunitandschoolarr;

          this.$refs.popupPicker.setSlotValue(0, this.userData.coach_identity);
          this.popupVisible = true;
        }
        if (key == "registerRegion") {
          this.pickerSlots = this.registerRegionSlots;
          this.$refs.popupPicker.setSlotValue(
            0,
            this.userData.coach_register_region
          );
          this.popupVisible = true;
        }
        if (key == "education") {
          this.pickerSlots = this.educationSlots;
          this.$refs.popupPicker.setSlotValue(0, this.userData.education);
          this.popupVisible = true;
        }
        if (key == "graduationDate") {
          if (this.userData.graduation_date == "请选择") {
            this.pickerValue = new Date("1990-01-01");
            console.log(this.pickerValue);
          } else {
            this.pickerValue = new Date(this.userData.graduation_date);
          }
          this.$refs.picker.open();
        }
        if (key == "intake") {
          if (this.userData.enrollment_date == "请选择") {
            this.pickerValue = new Date("1990-01-01");
            console.log(this.pickerValue);
          } else {
            this.pickerValue = new Date(this.userData.enrollment_date);
          }
          this.$refs.picker.open();
        }
        //执教开始时间
        if (key == "coach_train_begin_date") {
          this.Documentarrindex = itemindex;
          this.popupKey = key;
          this.userData.coach_experience_info.forEach((item) => {
            console.log(item);
            if (item.coach_train_begin_date == "请选择") {
              this.pickerValue = new Date("1990-01-01");
              console.log(this.pickerValue);
            } else {
              this.pickerValue = new Date(item.coach_train_begin_date);
            }
            this.$refs.picker.open();
          });
        }
        //执教结束时间
        if (key == "coach_train_end_date") {
          this.Documentarrindex = itemindex;
          this.popupKey = key;
          this.userData.coach_experience_info.forEach((item) => {
            console.log(item);
            if (item.coach_train_end_date == "请选择") {
              this.pickerValue = new Date("1990-01-01");
              console.log(this.pickerValue);
            } else {
              this.pickerValue = new Date(item.coach_train_end_date);
            }
            this.$refs.picker.open();
          });
        }
      }

      if (key == "certificateDate" && this.inputKey) {
        console.log(itemindex);
        this.popupKey = key;
        this.Documentarrindex = itemindex;
        this.userData.coach_certificate_info.forEach((item) => {
          console.log(item);
          if (item.coach_certificate_date == "请选择") {
            this.pickerValue = new Date("1990-01-01");
            console.log(this.pickerValue);
          } else {
            this.pickerValue = new Date(item.coach_certificate_date);
            console.log(item.coach_certificate_date, this.pickerValue, "sm");
          }
          this.$refs.picker.open();
        });
      }
      //培训开始时间
      if (key == "coach_train_begin_date" && this.inputKey) {
        this.popupKey = key;
        this.Documentarrindex = itemindex;
        this.userData.coach_certificate_info.forEach((item) => {
          if (item.coach_train_begin_date == "请选择") {
            this.pickerValue = new Date("1990-01-01");
            console.log(this.pickerValue);
          } else {
            this.pickerValue = new Date(item.coach_train_begin_date);
          }
          this.$refs.picker.open();
        });
      }
      //培训结束时间
      if (key == "coach_train_end_date" && this.inputKey) {
        this.popupKey = key;
        this.Documentarrindex = itemindex;
        this.userData.coach_certificate_info.forEach((item) => {
          if (item.coach_train_end_date == "请选择") {
            this.pickerValue = new Date("1990-01-01");
            console.log(this.pickerValue);
          } else {
            this.pickerValue = new Date(item.coach_train_end_date);
          }
          this.$refs.picker.open();
        });
      }
    },
    //证书新增
    clickDocumen() {
      this.userData.coach_certificate_info.push({
        coach_certificate_title: "请选择",
        coach_certificate_title: "", // 证书名称
        coach_certificate_level: "", // 证书等级
        coach_certificatelist: this.coach_certificatelist, //证书名称
        coach_certificate_levell: [], //证书等级
        coach_certificate_number: "", // 证书编号
        coach_certificate_date: "请选择", // 证书签发日期
        coach_certificate_company: "", // 发证单位
        coach_certificate_image: [], // 证书图片
        index: this.userData.coach_certificate_info.length,
        coach_train_title: "", // 培训名称
        coach_train_address: "", // 培训地点
        coach_train_image: [], // 参加培训的证明材料
        coach_train_begin_date: "请选择", //培训开始时间
        coach_train_end_date: "请选择", //培训结束时间
        coach_train_company: "", //培训单位
      });

      console.log(this.userData.coach_certificate_info, "证书新增");
    },
    //执教新增
    clickexperience() {
      this.userData.coach_experience_info.push({
        coach_experience: "", // 执教单位、
        coach_position: "", // 执教职务、
        coach_train_begin_date: "请选择", //执教开始时间
        coach_train_end_date: "请选择", //执教结束时间
        coach_honor: "", // 执教期间所获成绩及荣誉
        coach_honor_image: [], // 成绩及荣誉证明材料
        index: this.userData.coach_experience_info.length,
      });
      console.log(this.userData.coach_experience_info, "执教新增");
    },
    certificate_change(itemindex, itemcoach_certificate_title) {
      console.log(
        itemindex,
        itemcoach_certificate_title,
        // this.coach_certificatelist,
        this.userData.coach_certificate_info
      );
      this.userData.coach_certificate_info.forEach((item) => {
        console.log(item.index);
        item.coach_certificatelist.forEach((items) => {
          if (
            itemcoach_certificate_title == items.value &&
            item.index == itemindex
          ) {
            item.coach_certificate_levell = items.level;
            console.log(itemcoach_certificate_title);

            // item.coach_certificate_level = itemcoach_certificate_title.value;
          }
        });
      });

      // this.coach_certificatelist.forEach((item) => {
      //   if (itemcoach_certificate_title == item.value) {
      //     this.userData.coach_certificate_info.forEach((i) => {
      //       i.coach_certificate_level = itemcoach_certificate_title.value;
      //       this.coach_certificate_levell = item.level;
      //     });
      //   }
      // });
    },
    // picker选择
    onPickerChange: function (picker, values) {
      if (this.popupKey == "identityType") {
        if (values[0]) {
          if (values[0] == "") {
            this.identityTypeChange = "请选择";
          } else {
            this.identityTypeChange = values[0];
          }
        }
      }
      if (this.popupKey == "sex") {
        if (values[0]) {
          if (values[0] == "") {
            this.sexChange = "请选择";
          } else {
            this.sexChange = values[0];
            console.log(this.sexChange, "sdm");
          }
        }
      }
      if (this.popupKey == "workunitandschool") {
        if (values[0]) {
          console.log("0000");
          if (values[0] == "") {
            this.coach_identity = "请选择";
          } else {
            this.coach_identity = values[0];
            // console.log(this.workunitandschools, "sdm");
          }
        }
      }
      if (this.popupKey == "registerRegion") {
        if (values[0]) {
          if (values[0] == "") {
            this.registerRegionChange = "请选择";
          } else {
            this.registerRegionChange = values[0];
          }
        }
      }
      if (this.popupKey == "education") {
        if (values[0]) {
          if (values[0] == "") {
            this.educationChange = "请选择";
          } else {
            this.educationChange = values[0];
          }
        }
      }
    },

    // popup弹窗取消
    popupCancelFn: function () {
      let key = this.popupKey;
      if (key == "identityType") {
        this.identityTypeChange = this.identityTypevalueObj.label;
      }
      if (key == "sex") {
        this.sexChange = this.userData.sex;
      }
      if (key == "registerRegion") {
        this.registerRegionChange = this.userData.coach_register_region;
      }
      if (key == "education") {
        this.educationChange = this.userData.education;
      }
      this.popupVisible = false;
    },

    // popup弹窗确认
    popupConfirmFn: function () {
      let key = this.popupKey;
      if (key == "identityType") {
        if (this.identityTypevalueObj.label != this.identityTypeChange) {
          this.userData.identity_up = "";
          this.$refs.identityUp.value = "";
          this.userData.identity_down = "";
          this.$refs.identityDown.value = "";
        }
        this.identityTypevalueObj.label = this.identityTypeChange;
        // if (this.identityTypeChange === "请选择") {
        //   this.identityTypevalueObj.value = 0;
        // } else if (this.identityTypeChange === "身份证") {
        //   this.identityTypevalueObj.value = 1;
        // } else if (this.identityTypeChange === "护照") {
        //   this.identityTypevalueObj.value = 2;
        // } else if (this.identityTypeChange === "港、澳、台胞证件") {
        //   this.identityTypevalueObj.value = 3;
        // } else {
        //   this.identityTypevalueObj.value = 4;
        // }
        this.userData.identity_type = this.userData.value1;
      }
      if (key == "sex") {
        this.userData.sex = this.sexChange;
      }
      if (key == "workunitandschool") {
        this.userData.coach_identity = this.coach_identity;
      }
      if (key == "registerRegion") {
        this.userData.coach_register_region = this.registerRegionChange;
      }
      if (key == "education") {
        this.userData.education = this.educationChange;
      }
      this.popupVisible = false;
    },
    // 时间选择确认
    handleConfirm: function () {
      let key = this.popupKey;
      if (key == "brith") {
        this.userData.brith = this.formatDate(this.pickerValue);
      }

      if (key == "graduationDate") {
        this.userData.graduation_date = this.formatDate(this.pickerValue);
      }
      if (key == "intake") {
        this.userData.enrollment_date = this.formatDate(this.pickerValue);
      }
      // 执教开始时间
      if (key == "coach_train_begin_date") {
        this.userData.coach_experience_info.forEach((item, index) => {
          console.log(this.pickerValue);
          console.log(this.Documentarrindex, "this.Documentarrindex");
          console.log(index, "index");
          if (this.Documentarrindex == index) {
            item.coach_train_begin_date = this.formatDate(this.pickerValue);
          }
          console.log(item, "item");
        });
      }
      // 执教开始时间
      if (key == "coach_train_end_date") {
        this.userData.coach_experience_info.forEach((item, index) => {
          console.log(this.pickerValue);
          console.log(this.Documentarrindex, "this.Documentarrindex");
          console.log(index, "index");
          if (this.Documentarrindex == index) {
            item.coach_train_end_date = this.formatDate(this.pickerValue);
          }
          console.log(item, "item");
        });
      }
      if (key == "certificateDate") {
        this.userData.coach_certificate_info.forEach((item, index) => {
          console.log(this.pickerValue);
          console.log(this.Documentarrindex, "this.Documentarrindex");
          console.log(index, "index");
          if (this.Documentarrindex == index) {
            item.coach_certificate_date = this.formatDate(this.pickerValue);
          }
          console.log(item, "item");
        });
      }
      //培训开始时间
      if (key == "coach_train_begin_date") {
        this.userData.coach_certificate_info.forEach((item, index) => {
          if (this.Documentarrindex == index) {
            item.coach_train_begin_date = this.formatDate(this.pickerValue);
          }
          console.log(item, "item");
        });
      }
      //培训结束时间
      if (key == "coach_train_end_date") {
        this.userData.coach_certificate_info.forEach((item, index) => {
          if (this.Documentarrindex == index) {
            item.coach_train_end_date = this.formatDate(this.pickerValue);
          }
          console.log(item, "item");
        });
      }
    },
    //证书类别集合
    coach_certificatearr() {
      let url = "/mobile/coachCertificate";
      Indicator.open();
      this.axios.post(url).then((res) => {
        Indicator.close();
        if (res.code == 0) {
          console.log(res, "2222");
          this.coach_certificatelist = res.data;
          this.userData.coach_certificate_info.forEach((item) => {
            item.coach_certificatelist = res.data;
          });

          console.log(this.coach_certificatelist);
          // this.userData.coach_certificate_info.forEach((item) => {
          //   this.coach_certificate_title = item.coach_certificate_title;
          //   this.coach_certificatelist.forEach((i) => {
          //     if (item.coach_certificate_title == i.value) {
          //       this.coach_certificate_levell = i.level;
          //       // console.log(this.coach_certificate_levell, "shuzhu");
          //     }
          //   });
          // });
        }
      });
    },
    changcoach_certificatee() {
      console.log(this.coach_certificate);
    },

    // 提交信息
    submitDataFn: function (key) {
      // if (key == 1) {
      //   delete data.coach_certificate_title;
      //   delete data.coach_certificate_level;
      //   delete data.coach_certificate_number;
      //   delete data.coach_certificate_date;
      //   delete data.coach_certificate_company;
      //   delete data.coach_certificate_image;
      //   if (this.userData.coach_experience == "") {
      //     Toast({
      //       message: "请先完善执教信息",
      //     });
      //     return false;
      //   }
      // } else {
      this.userData.coach_certificate_info.forEach((item) => {
        let that = this;
        if (this.userData.value1 == 1 || this.userData.value1 == 2) {
          console.log(item);
          if (
            item.coach_certificate_title == "" ||
            item.coach_certificate_level == "" ||
            item.coach_certificate_number == "" ||
            item.coach_certificate_date == "" ||
            item.coach_certificate_date == "请选择" ||
            item.coach_certificate_company == "" ||
            item.coach_certificate_image.length == 0
          ) {
            Toast({
              message: "请先完善证件信息",
            });
            return false;
          }
        } else {
          if (
            item.coach_certificate_title == "" ||
            item.coach_certificate_level == "" ||
            item.coach_certificate_number == "" ||
            item.coach_certificate_date == "" ||
            item.coach_certificate_date == "请选择" ||
            item.coach_certificate_company == "" ||
            item.coach_certificate_image.length == 0
          ) {
            Toast({
              message: "请先完善证件信息",
            });
            return false;
          }
        }
        let url = "/mobile/completeCoachInfo";
        this.userData.identity_type = this.userData.value1;

        let data = JSON.parse(JSON.stringify(this.userData));
        console.log(data);

        // }

        MessageBox.confirm("确认提交?").then(() => {
          Indicator.open();
          this.axios
            .post(url, data)
            .then((response) => {
              Indicator.close();
              if (response.code == 0) {
                Toast({
                  message: "提交成功",
                  duration: 3000,
                });
                sessionStorage.removeItem("COACHREGISTEROBJ");
                this.$router.replace({
                  name: "CoachHome",
                });
              } else {
                Toast({
                  message: response.msg,
                  duration: 3000,
                });
              }
            })
            .catch(function (error) {
              Indicator.close();
              console.log(error);
            });
        });
      });
    },

    // 检查是否完善过信息
    checkUserInfoFn: function () {
      let that = this;
      let url = "/mobile/checkUserInfo";
      let data = {};
      Indicator.open();
      this.axios
        .post(url, data)
        .then((response) => {
          Indicator.close();
          if (response.code == 0) {
            this.coach_remark = response.response;
            if (response.is_coach_register == 1) {
              that.auditStatus = response.coach_audit_status;

              if (that.auditStatus != 0) {
                that.inputKey = false;
              }
              that.getDetailDataFn(1);
            } else {
              if (response.is_complete == 2) {
                that.getDetailDataFn(2);
              } else {
                let temporary = JSON.parse(
                  sessionStorage.getItem("COACHREGISTEROBJ")
                );

                if (temporary) {
                  that.userData = temporary;
                  // that.identityTypevalueObj.value = response.info.identity_type;
                  // console.log(response.info.identity_type);
                  // console.log(that.identityTypevalueObj.value, "232323");
                  // if (response.info.identity_type == 1) {
                  //   that.identityTypevalueObj.label = "身份证";
                  // }
                  // if (response.info.identity_type == 2) {
                  //   that.identityTypevalueObj.label = "护照";
                  // }
                  // if (response.info.identity_type == 3) {
                  //   that.identityTypevalueObj.label = "港、澳、台胞证件";
                  // }
                  // if (response.info.identity_type == 4) {
                  //   that.identityTypevalueObj.label = "其他";
                  // }
                }
              }
            }
          } else {
            Toast({
              message: response.msg,
              duration: 3000,
            });
          }
        })
        .catch(function (error) {
          Indicator.close();
          console.log(error);
        });
    },

    // 获取用户信息
    getDetailDataFn: function (key) {
      let that = this;
      let url = "";
      url = "/mobile/getUserInfo";
      // if (key == 1) {
      //   url = "/mobile/getCoachInfo";
      // } else {

      // }
      let data = {};
      Indicator.open();
      this.axios
        .post(url, data)
        .then((response) => {
          Indicator.close();
          if (response.code == 0) {
            console.log(response, "response");
            that.userCoachId = response.info.id;
            this.userData.value1 = response.info.identity_type;
            that.idname = response.info.name;
            that.idnumber = response.info.identity_number;
            this.userData.coach_experience_info =
              response.info.coach_experience_info; //执教数组
            this.userData.coach_certificate_info =
              response.info.coach_certificate_info; //证书数组
            this.userData.coach_certificate_info.forEach((item, index) => {
              this.Documentarrindex = index;
              console.log(item, "isdssk");
              item.coach_certificatelist = response.info.coach_certificatelist;
              item.coach_certificatelist.forEach((items) => {
                if (item.coach_certificate_title == items.value) {
                  item.coach_certificate_levell = items.level;
                }
              });
            });
            console.log(this.userData.coach_certificate_info);
            let selectList = [
              "sex",
              "brith",
              "coach_register_region",
              "education",
              "graduation_date",
              "coach_certificate_date",
            ];

            for (let reKey in response.info) {
              let strIndex = selectList.findIndex((item) => {
                // console.log(item);
                return item == reKey;
              });
              if (strIndex != -1) {
                if (
                  response.info[reKey] == null ||
                  response.info[reKey] == ""
                ) {
                  that.userData[reKey] = "请选择";
                } else {
                  that.userData[reKey] = response.info[reKey];
                }
              } else {
                that.userData[reKey] =
                  response.info[reKey] == null ? "" : response.info[reKey];
              }
            }
            that.isCertificate = response.info.is_coach_certificate_write;
            if (that.isCertificate == 1) {
              that.inpuCertificatetKey = false;
            }
            // that.identityTypevalueObj.value = response.info.identity_type;
            // if (response.info.identity_type == 1) {
            //   that.identityTypevalueObj.label = "身份证";
            // }
            // if (response.info.identity_type == 2) {
            //   that.identityTypevalueObj.label = "护照";
            // }
            // if (response.info.identity_type == 3) {
            //   that.identityTypevalueObj.label = "港、澳、台胞证件";
            // }
            // if (response.info.identity_type == 4) {
            //   that.identityTypevalueObj.label = "其他";
            // }
          } else {
            Toast({
              message: response.msg,
              duration: 3000,
            });
          }
        })
        .catch(function (error) {
          Indicator.close();
          console.log(error);
        });
    },
    change() {
      // console.log(this.userData.value1, "22222");
      this.userData.identity_up = "";
      this.userData.identity_down = "";
    },
    // 上传头像图片
    uploadImgBtn: function (e) {
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 3) {
        Toast({
          message: "照片大小超过3MB",
          duration: 3000,
        });
        that.$refs.uploadImg.value = "";
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            let image = new Image();
            image.onload = function () {
              let width = image.width;
              let height = image.height;
              let cl = height / width;
              if (cl >= 1.28 && cl <= 1.52) {
                that.uploadImgFn(res.target.result);
              } else {
                that.$refs.uploadImg.value = "";
                Toast({
                  message: "照片尺寸不合规",
                  duration: 3000,
                });
              }
            };
            image.src = res.target.result;
          };
          reader.readAsDataURL(file);
        }
      }
    },

    // 上传头像图片到服务器
    uploadImgFn: function (imgData) {
      let that = this;
      let url = "/upload/uploadPhoto";
      let data = {
        source: 1,
        file: imgData,
      };
      Indicator.open("上传中...");
      this.axios
        .post(url, JSON.stringify(data))
        .then((response) => {
          Indicator.close();
          if (response.code == 0) {
            if (response.is_face == 1) {
              let path = response.image;
              that.uploadUrl = response.image;
              that.userData.photo = path;
            } else {
              console.log("请上传人脸图片!");
            }
          } else {
            Toast({
              message: response.msg,
              duration: 3000,
            });
          }
        })
        .catch(function (error) {
          Indicator.close();
          console.log(error);
        });
    },

    // 选择上传培训证明材料
    uploadCoachTrainImageBtn: function (e, itemindex) {
      this.Documentarrindex = itemindex;
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 5) {
        Toast({
          message: "照片大小超过5MB",
          duration: 3000,
        });
        that.$refs.uploadCoachTrainImage.value = "";
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            that.uploadImgFlieFn(res.target.result, 10);
          };
          reader.readAsDataURL(file);
        }
      }
    },
    // 选择上传成绩及荣誉证明材料
    uploadCoachHonorImageBtn: function (e, itemindex) {
      this.Documentarrindex = itemindex;
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 5) {
        Toast({
          message: "照片大小超过5MB",
          duration: 3000,
        });
        that.$refs.uploadCoachHonorImage.value = "";
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            that.uploadImgFlieFn(res.target.result, 12);
          };
          reader.readAsDataURL(file);
        }
      }
    },
    // 选择上传证书图片
    uploadCoachCertificateImageBtn: function (e, itemindex) {
      // console.log(itemindex);
      this.Documentarrindex = itemindex;
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 5) {
        Toast({
          message: "照片大小超过5MB",
          duration: 3000,
        });
        that.$refs.uploadCoachCertificateImage.value = "";
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            that.uploadImgFlieFn(res.target.result, 11);
          };
          reader.readAsDataURL(file);
        }
      }
    },
    // 上传图片到服务器
    uploadImgFlieFn: function (imgData, key) {
      let that = this;
      let url = "/upload/uploadImage";
      let source = key;
      let data = {
        source: source,
        img: imgData,
      };
      Indicator.open("上传中...");
      this.axios
        .post(url, JSON.stringify(data))
        .then((response) => {
          Indicator.close();
          if (response.code == 0) {
            let path = response.image_path;
            if (source == 10) {
              // this.userData.coach_train_image.push(path);
              // this.userData.coach_certificate_info.forEach((item, index) => {
              //   if (this.Documentarrindex == index) {

              //   }
              // });
              this.userData.coach_certificate_info.forEach((item, index) => {
                if (this.Documentarrindex == index) {
                  item.coach_train_image.push(path);
                }
              });
            }

            if (source == 12) {
              this.userData.coach_experience_info.forEach((item, index) => {
                console.log(this.Documentarrindex, index, "index");
                if (this.Documentarrindex == index) {
                  item.coach_honor_image.push(path);
                }
              });
              // this.userData.coach_honor_image.push(path);
            }
            if (source == 11) {
              this.userData.coach_certificate_info.forEach((item, index) => {
                if (this.Documentarrindex == index) {
                  item.coach_certificate_image.push(path);
                }
              });
              // that.userData.coach_certificate_image.push(path);
            }
          } else {
            Toast({
              message: response.msg,
              duration: 3000,
            });
          }
        })
        .catch(function (error) {
          Indicator.close();
          console.log(error);
        });
    },

    //上传身份证正面
    uploadIdentityBtn: function (e, id) {
      // console.log(e, id, "222");
      this.type = id;
      console.log(typeof this.type);
      let that = this;
      let file = e.target.files[0];

      if (file != undefined && file != null) {
        let reader = new FileReader();
        reader.onload = (res) => {
          that.uploadIdentityFn(res.target.result, 1);
          console.log(res);
        };
        reader.readAsDataURL(file);
      }
    },
    // 上传身份证背面
    uploadIdentityDownBtn: function (e, id) {
      this.type = id;
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 3) {
        that.$refs.identityDown.value = "";
        Toast({
          message: "照片大小超过3MB",
          duration: 3000,
        });
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            that.uploadIdentityFn(res.target.result, 2);
          };
          reader.readAsDataURL(file);
        }
      }
    },
    // 上传身份证到服务器
    uploadIdentityFn: function (imgData) {
      if (this.userData.value1 == 1) {
        let that = this;
        let url = "/upload/uploadCardup";
        // let uploadType = type;
        let data = {
          type: this.type,
          file: imgData,
        };
        Indicator.open("上传中...");
        this.axios
          .post(url, JSON.stringify(data))
          .then((response) => {
            Indicator.close();
            if (response.code == 0) {
              // console.log(response, "2232");

              // console.log(this.type);

              let path = response.image;
              console.log(that.type, "that.type");
              if (that.type == 1) {
                // console.log(999);
                // that.identity_up = response.image;
                that.idname = response.idname;
                that.idnumber = response.idnumber;
                that.userData.identity_up = path;
              } else {
                that.identity_down = response.image;
                that.userData.identity_down = path;
              }
            } else {
              Toast({
                message: response.msg,
                duration: 3000,
              });
            }
          })
          .catch(function (error) {
            Indicator.close();
            // console.log(error);
          });
      } else if (this.userData.value1 != 1) {
        this.userData.identity_up = "";

        let that = this;
        if (
          that.userData.value1 == 2 ||
          that.userData.value1 == 3 ||
          that.userData.value1 == 4
        ) {
          that.value1 = 7;
        }
        let url = "/upload/uploadImage";
        let data = {
          source: that.value1,
          img: imgData,
        };
        Indicator.open("上传中...");
        this.axios
          .post(url, JSON.stringify(data))
          .then((res) => {
            Indicator.close();
            // console.log(res, "222");
            if (res.code == 0) {
              // console.log(res.image_path, "res");
              let path = res.image_path;
              if (that.type == "1") {
                // let path = res.image_path;

                // that.identity_up = res.image_path;
                // that.imggea = that.identity_up;
                // console.log(that.identity_up, "2222");
                that.userData.identity_up = path;
              }

              // that.imggea = that.userData.identity_up;
            } else {
              Toast({
                message: res.msg,
                duration: 3000,
              });
            }
          })
          .catch(function (error) {
            Indicator.close();
            // console.log(error);
          });
      }
    },
    //上传护照或者港澳台 照片的正面
    uploadbut: function (e, id) {
      this.type = id;
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 3) {
        Toast({
          message: "照片大小超过3MB",
          duration: 3000,
        });
        that.$refs.uploadImg.value = "";
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            let image = new Image();
            image.onload = function () {
              let width = image.width;
              let height = image.height;
              let cl = height / width;
              that.uploadIdentityFn(res.target.result);
            };
            image.src = res.target.result;
          };
          reader.readAsDataURL(file);
        }
      }
    },
    //上传护照或者港澳台 照片的反面
    uploadbutdown: function (e, id) {
      this.type = id;
      let that = this;
      let file = e.target.files[0];
      if (file.size > 1024 * 1024 * 3) {
        Toast({
          message: "照片大小超过3MB",
          duration: 3000,
        });
        that.$refs.uploadImg.value = "";
      } else {
        if (file != undefined && file != null) {
          let reader = new FileReader();
          reader.onload = (res) => {
            let image = new Image();
            image.onload = function () {
              let width = image.width;
              let height = image.height;
              let cl = height / width;
              that.uploadImgFndown(res.target.result);
            };
            image.src = res.target.result;
          };
          reader.readAsDataURL(file);
        }
      }
    },
    uploadImgFndown: function (imgData) {
      let that = this;
      if (
        that.userData.value1 == 2 ||
        that.userData.value1 == 3 ||
        that.userData.value1 == 4
      ) {
        that.value1 = 7;
      }
      let url = "/upload/uploadImage";
      let data = {
        source: that.value1,
        img: imgData,
      };
      Indicator.open("上传中...");
      this.axios
        .post(url, JSON.stringify(data))
        .then((res) => {
          Indicator.close();
          // console.log(res, "222");
          if (res.code == 0) {
            let path = res.image_path;
            that.userData.identity_down = path;
          } else {
            Toast({
              message: res.msg,
              duration: 3000,
            });
          }
        })
        .catch(function (error) {
          Indicator.close();
          // console.log(error);
        });
    },

    // 上传图片到服务器正

    // 下一步
    nextStep: function () {
      console.log("222");
      if (this.userData.coach_identity == "请选择") {
        Toast({
          message: "请先完善基本信息",
        });
        return false;
      }
      if (
        (this.userData.value1 == 3 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "学校") ||
        (this.userData.value1 == 4 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "学校")
      ) {
        if (
          this.userData.photo == "" ||
          this.userData.name == "" ||
          this.userData.sex == "" ||
          this.userData.sex == "请选择" ||
          this.userData.brith == "" ||
          this.userData.brith == "请选择" ||
          this.userData.height == "" ||
          this.userData.weight == "" ||
          this.userData.coach_register_region == "" ||
          this.userData.coach_register_region == "请选择" ||
          this.userData.enrollment_date == "" ||
          this.userData.enrollment_date == "请选择" ||
          // this.userData.company == "" ||
          // this.userData.position == "" ||
          // this.userData.education == "" ||
          // this.userData.education == "请选择" ||
          // this.userData.school == "请选择" ||
          // this.userData.graduation_date == "" ||
          // this.userData.graduation_date == "请选择" ||
          this.userData.email == "请选择" ||
          this.userData.address == "" ||
          this.userData.identity_up == ""
        ) {
          Toast({
            message: "请先完善基本信息",
          });
          return false;
        }
        this.stepKey = this.stepKey + 1;
      } else if (
        (this.userData.value1 == 2 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "学校") ||
        (this.userData.value1 == 1 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "学校")
      ) {
        if (
          this.userData.photo == "" ||
          this.userData.name == "" ||
          this.userData.sex == "" ||
          this.userData.sex == "请选择" ||
          this.userData.brith == "" ||
          this.userData.brith == "请选择" ||
          this.userData.height == "" ||
          this.userData.weight == "" ||
          this.userData.coach_register_region == "" ||
          this.userData.coach_register_region == "请选择" ||
          this.userData.enrollment_date == "" ||
          this.userData.enrollment_date == "请选择" ||
          // this.userData.company == "" ||
          // this.userData.position == "" ||
          // this.userData.education == "" ||
          // this.userData.education == "请选择" ||
          // this.userData.school == "请选择" ||
          // this.userData.graduation_date == "" ||
          // this.userData.graduation_date == "请选择" ||
          this.userData.email == "请选择" ||
          this.userData.address == "" ||
          this.userData.identity_up == ""
        ) {
          Toast({
            message: "请先完善基本信息",
          });
          return false;
        }
        this.stepKey = this.stepKey + 1;
      }
      if (
        (this.userData.value1 == 3 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "工作单位") ||
        (this.userData.value1 == 4 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "工作单位")
      ) {
        if (
          this.userData.photo == "" ||
          this.userData.name == "" ||
          this.userData.sex == "" ||
          this.userData.sex == "请选择" ||
          this.userData.brith == "" ||
          this.userData.brith == "请选择" ||
          this.userData.height == "" ||
          this.userData.weight == "" ||
          this.userData.coach_register_region == "" ||
          this.userData.coach_register_region == "请选择" ||
          this.userData.company == "" ||
          this.userData.position == "" ||
          this.userData.education == "" ||
          this.userData.education == "请选择" ||
          this.userData.school == "请选择" ||
          this.userData.graduation_date == "" ||
          this.userData.graduation_date == "请选择" ||
          this.userData.email == "请选择" ||
          this.userData.address == "" ||
          this.userData.identity_up == ""
        ) {
          Toast({
            message: "请先完善基本信息",
          });
          return false;
        }
        this.stepKey = this.stepKey + 1;
      } else if (
        (this.stepKey == 1 &&
          this.userData.value1 == 2 &&
          this.userData.coach_identity == "工作单位") ||
        (this.userData.value1 == 1 &&
          this.stepKey == 1 &&
          this.userData.coach_identity == "工作单位")
      ) {
        if (
          this.userData.photo == "" ||
          this.userData.name == "" ||
          this.userData.sex == "" ||
          this.userData.sex == "请选择" ||
          this.userData.brith == "" ||
          this.userData.brith == "请选择" ||
          this.userData.height == "" ||
          this.userData.weight == "" ||
          this.userData.coach_register_region == "" ||
          this.userData.coach_register_region == "请选择" ||
          this.userData.company == "" ||
          this.userData.position == "" ||
          this.userData.education == "" ||
          this.userData.education == "请选择" ||
          this.userData.school == "请选择" ||
          this.userData.graduation_date == "" ||
          this.userData.graduation_date == "请选择" ||
          this.userData.email == "请选择" ||
          this.userData.address == "" ||
          this.userData.identity_down == "" ||
          this.userData.identity_up == ""
        ) {
          Toast({
            message: "请先完善基本信息",
          });
          return false;
        } else if (this.userData.value1 == 1 && this.stepKey == 1) {
          // 验证身份正则
          let idNumberText =
            /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/;
          if (!idNumberText.test(this.userData.identity_number)) {
            Toast({
              message: "身份证格式不正确",
            });
            return false;
          }
          if (
            this.idnumber != this.userData.identity_number ||
            this.idname != this.userData.name
          ) {
            Toast({
              message: "身份信息与上传照片信息不符",
            });
            return false;
          }
        }
        console.log(
          this.idname,
          "this.userData.identity_number",
          this.userData.name
        );
        this.stepKey = this.stepKey + 1;
      }
      if (this.userData.coach_certificate_info.length == 0) {
        this.userData.coach_certificate_info.push({
          coach_certificate_title: "请选择",
          coach_certificate_title: "", // 证书名称
          coach_certificate_level: "", // 证书等级
          coach_certificate_number: "", // 证书编号
          coach_certificatelist: this.coach_certificatelist, //证书名称
          coach_certificate_levell: [], //证书等级
          coach_certificate_date: "请选择", // 证书签发日期
          coach_certificate_company: "", // 发证单位
          coach_certificate_image: [], // 证书图片
          index: this.userData.coach_certificate_info.length,
          coach_train_title: "", // 培训名称
          coach_train_address: "", // 培训地点
          coach_train_image: [], // 参加培训的证明材料
          coach_train_begin_date: "请选择", //培训开始时间
          coach_train_end_date: "请选择", //培训结束时间
          coach_train_company: "", //
        });

        console.log("29392932939", this.userData.coach_certificate_info);
      }
      //  else if (this.stepKey == 1) {
      //   if (
      //     this.userData.coach_train_title == "" ||
      //     this.userData.coach_train_address == "" ||
      //     this.userData.coach_train_image.length == 0
      //   ) {
      //     Toast({
      //       message: "请先完善专业信息",
      //     });
      //     return false;
      //   }
      //   this.stepKey = this.stepKey + 1;
      // }
      // else if (this.stepKey == 3) {
      //   this.stepKey = this.stepKey + 1;
      // }
    },

    // 返回
    toBackFn: function () {
      if (this.stepKey == 1) {
        this.$router.go(-1);
      } else {
        this.stepKey = this.stepKey - 1;
      }
    },
    // 返回首页
    toHome: function () {
      this.$router.go(-1);
    },
    // 格式化时间
    formatDate: function (val) {
      let d = new Date(val);
      let curr_date = d.getDate();
      let curr_month = d.getMonth() + 1;
      let curr_year = d.getFullYear();
      String(curr_month).length < 2
        ? (curr_month = "0" + curr_month)
        : curr_month;
      String(curr_date).length < 2 ? (curr_date = "0" + curr_date) : curr_date;
      let yyyyMMdd = curr_year + "-" + curr_month + "-" + curr_date;
      return yyyyMMdd;
    },
    // 移除图片
    removeImg: function (index, key, itemindex) {
      if (key == 1) {
        this.userData.coach_certificate_info.forEach((item, indexs) => {
          if (itemindex == indexs) {
            item.coach_certificate_image.splice(index, 1);
          }
        });
      } else if (key == 2) {
        this.userData.coach_experience_info.forEach((item, indexs) => {
          if (itemindex == indexs) {
            item.coach_honor_image.splice(index, 1);
          }
        });
        // this.userData.coach_honor_image.splice(index, 1);
      } else if (key == 3) {
        console.log(itemindex);
        this.userData.coach_certificate_info.forEach((item, indexs) => {
          if (itemindex == indexs) {
            item.coach_train_image.splice(index, 1);
          }
        });

        // this.userData.coach_certificate_info.splice(index, 1);
      }
    },
    // 删除证书模块
    deleteItem(itemss, index) {
      this.userData.coach_certificate_info.forEach((item, indexs) => {
        if (itemss.index == indexs) {
          this.userData.coach_certificate_info.splice(index, 1);
        }
      });
    },
    //删除执教模块
    traindeleteItem(itemss, index) {
      // console.log(itemss, "itemss");/
      this.userData.coach_experience_info.forEach((item, indexs) => {
        // console.log(itemss.index, "itemss");
        // console.log(indexs, "indexs");
        if (itemss.index == indexs) {
          this.userData.coach_experience_info.splice(index, 1);
        }
      });
    },
    // 重新提交
    reSubmitDataFn: function () {
      this.stepKey = 1;
      this.inputKey = true;
      this.inpuCertificatetKey = true;
    },
  },
  watch: {
    coach_certificate_title: function (newQuestion, oldQuestion) {
      console.log(newQuestion, "newQuestion");
      for (let i = 0; i < this.coach_certificatelist.length; i++) {
        if (newQuestion == this.coach_certificatelist[i].value) {
          this.coach_certificate_level = this.coach_certificatelist[i].value;
          this.coach_certificate_levell = this.coach_certificatelist[i].level;
        }
      }
    },
  },
  // userData: {
  //   handler(newval) {
  //     sessionStorage.setItem("COACHREGISTEROBJ", JSON.stringify(newval));
  //   },
  //   deep: true,
  // },
};
</script>
<style>
.van-dropdown-menu__bar {
  background-color: #ffff !important;
  box-shadow: none !important;
}

.van-popup--top {
  width: 6.95rem !important;
  margin-left: 0.27rem;
  /* left: 50%; */
  /* transform: translateX(-50%); */
}
.van-dropdown-menu__item {
  justify-content: space-between !important;
}
.imgs {
  display: flex;
  justify-content: space-around;
}
</style>
